﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessRules;
using System.Data;
using System.Collections;

namespace BusinessLibary
{
    public class YBFWSSInfoFacade
    {

        public YBFWSSInfoFacade()
        {
        }


        #region 业务外观层操作

        public void insertEntity(DataSet entityData)
        {
            try
            {
                YBFWSSInfoRules rule = new YBFWSSInfoRules();
                rule.insertEntity(entityData);
            }
            catch (Exception e)
            {
                throw new Exception(e.Message, e);
            }
        }


        public void updateEntity(DataSet entityData)
        {
            try
            {
                YBFWSSInfoRules rule = new YBFWSSInfoRules();
                rule.updateEntity(entityData);
            }
            catch (Exception e)
            {
                throw new Exception(e.Message, e);
            }
        }


        public void deleteEntity(DataSet entityData)
        {
            try
            {
                YBFWSSInfoRules rule = new YBFWSSInfoRules();
                rule.deleteEntity(entityData);
            }
            catch (Exception e)
            {
                throw new Exception(e.Message, e);
            }
        }


        public DataSet FindByPrimaryKey(object strKeyValue)
        {
            try
            {
                YBFWSSInfoRules rule = new YBFWSSInfoRules();
                return rule.FindByPrimaryKey(strKeyValue);
            }
            catch (Exception e)
            {
                throw new Exception(e.Message, e);
            }
        }


        public DataSet FindByPrimaryKey(ArrayList KeyValue)
        {
            try
            {
                YBFWSSInfoRules rule = new YBFWSSInfoRules();
                return rule.FindByPrimaryKey(KeyValue);
            }
            catch (Exception e)
            {
                throw new Exception(e.Message, e);
            }
        }

        #endregion

        /// <summary>
        /// 清空实体记录
        /// </summary>
        public void deleteEntity()
        {
            try
            {
                YBFWSSInfoRules rule = new YBFWSSInfoRules();
                rule.deleteEntity();
            }
            catch (Exception e)
            {
                throw new Exception(e.Message, e);
            }
        }

        public int ImportFromZL(DataSet ds)
        {
            try
            {
                YBFWSSInfoRules rule = new YBFWSSInfoRules();
                 return rule.ImportFromZL(ds);
            }
            catch (Exception e)
            {
                throw new Exception(e.Message, e);
            }
        }
    }
}
